%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Airy formula for a Fabry-Perot with mirrors of different reflexion including absorption.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;

R1= .95;																																	%Reflexions
R2= .95;
S1= .001;																																	%Absorptions
S2= .001;
T1=1-R1-S1;																																	%Transmissions
T2=1-R2-S2;  
ph=[-1:.002:2]*2*pi;

Ne=(1-sqrt(R1*R2))^2+4*sqrt(R1*R2)*sin(ph/2).^2;
It=T1*T2./Ne;
Ir=((sqrt(R1)-(R1+T1)*sqrt(R2))^2+4*(R1+T1)*sqrt(R1*R2)*sin(ph/2).^2)./Ne;
ff=sqrt(R1*R2);
F =pi*sqrt(ff)/(1-ff)

figure(1);			clf;
subplot(221),plot(ph/pi,100*It,'LineWidth',1.4)
set(gca,'FontSize',16,'LineWidth',1.4);
xlabel('\fontsize{16}{\itPhase} (\pi)')
ylabel('\fontsize{16}{\itTransmission (%)}')
axis([min(ph/pi) max(ph/pi) 0 100])
subplot(222),plot(ph/pi,100*Ir,'LineWidth',1.4)
set(gca,'FontSize',16,'LineWidth',1.4);
xlabel('\fontsize{16}{\itPhase} (\pi)')
ylabel('\fontsize{16}{\itReflexion} (%)')
axis([min(ph/pi) max(ph/pi) 0 100])
